import random
import sys

alphabet = list('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')

def random_string(n):
    return ''.join(random.choices(alphabet, k=n))

def populate_company(num):
    with open('company.csv', 'w') as f:
        for i in range(1, num+1):
            f.write('%d,%s\n' % (i, random_string(16)))

def populate_employee(start_id, size, company_num):
    with open('employee.csv', 'w') as f:
        for i in range(start_id, start_id+size):
            f.write('%d,%s,%d\n' % (i, random_string(16), random.randint(1, company_num)))

if __name__ == '__main__':
    company_n = 5000
    size = company_n * 100
    populate_company(company_n);
    print('done with company', file=sys.stderr)
    populate_employee(1, size, company_n)
    print('done with employee', file=sys.stderr)
